package com.dllo.lanou.cookapp.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.dllo.lanou.cookapp.R;

import org.w3c.dom.Text;

import butterknife.Bind;
import butterknife.ButterKnife;

public class AddCookContentActivity extends AppCompatActivity implements View.OnClickListener {
   @Bind(R.id.add_title)
    TextView add_title;
    @Bind(R.id.add_send)
    TextView add_send;
    @Bind(R.id.add_contents)
    EditText add_contents;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_cook_step);
        ButterKnife.bind(this);
        add_send.setOnClickListener(this);

        Intent intent= getIntent();
        String title = intent.getStringExtra("title_content");
        if (title !=null){

            add_title.setText(title);
        }
    }


    @Override
    public void onClick(View v) {
        String content = add_contents.getText().toString();
        Intent intent = new Intent();
        intent.putExtra("content",content);
        setResult(98, intent);
        finish();
    }
}
